﻿using Sl.Duplex;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sl.Duplex {
	public class DuplexPair {

		public IDuplex A { get; }
		public IDuplex B { get; }
		//这个类包含两个IDuplex 他们互相对接
		public DuplexPair(IDuplex a,IDuplex b) {
			A = a;
			B = b;
			A.RecvMutBytes = (ds, b, offset, count) => {
				B.sendAllBytes(b, offset, count);

			};
			B.RecvMutBytes = (ds, b, offset, count) => {
				A.sendAllBytes(b, offset, count);
			};
		}

	}
}
